package com.bigdata.service.imp;

import com.bigdata.dao.ResumeMapper;
import com.bigdata.pojo.Resume;
import com.bigdata.service.IResumeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

@Service
public class ResumeService implements IResumeService {


    @Autowired
    private ResumeMapper resumeMapper;

    @Override
    public List<Resume> findAll() {

        return resumeMapper.findAll();
    }

    @Override
    public Resume findById(Long id) {

        Optional<Resume> optional = resumeMapper.findById(id);
        Resume resume = optional.get();
        return resume;
    };

    @Override
    public void updateById(Resume resume) {
        resumeMapper.save(resume);
    }

    @Override
    public void deleteById(Long id) {
        resumeMapper.deleteById(id);
    }

    @Override
    public void save(Resume resume) {
        resumeMapper.save(resume);
    }
}
